#include <bits/stdc++.h>
using namespace std ;

const int maxn = 1e5 + 5 ;
int n, r[maxn], tot[maxn] ;
int qm[maxn] ; // record how many duels in front of the position now

int main() {

    freopen("duel.in", "r", stdin) ;
    freopen("duel.out", "w", stdout) ;

	scanf("%d", &n) ;
	for (int i = 1; i <= n; ++ i)
		scanf("%d", &r[i]), tot[r[i]] ++ ;
	
	qm[0] = 0, tot[0] = 0 ;
	for (int i = 1; i <= 100001; ++ i) {
		qm[i] = qm[i - 1] + tot[i - 1] ;
	}
	
	int ans = n ;
	bool flag = false ;
	int x = 0 ; // record the changed qm[i]
	for (int i = 1; i <= 100001; ++ i) {
		if (qm[i] != 0) {
			if (flag == true) qm[i] = x ;
			ans = ans - min(qm[i], tot[i]) ;
			qm[i] = max(0, qm[i] - tot[i]) ;
			x = qm[i] + tot[i] ;
			flag = true ;
		}
	}	printf("%d\n", ans) ;
	
    return 0 ;
}	// 100 pts
